home *** CD-ROM | disk | FTP | other *** search
/ Champak 99 / (Vol 99) Jan 19 2010.iso / Games / artifact_catcher.swf / scripts / DefineSprite_44 / frame_1 / DoAction.as
Encoding:
Text File  |  2010-01-19  |  1.7 KB  |  80 lines

  1. _root.vases.gotoAndStop(_root.misses + 1);
  2. if(_root.time == 0 && _root.milliseconds == 0)
  3. {
  4.    _root.gotoAndStop("win");
  5.    _parent.gotoAndStop("win");
  6. }
  7. else if(_root.vases._currentFrame == 4)
  8. {
  9.    _root.gotoAndStop("lose");
  10.    _parent.gotoAndStop("lose");
  11. }
  12. if(Key.isDown(Key.RIGHT))
  13. {
  14.    _parent.right = _parent.right + 1;
  15. }
  16. else
  17. {
  18.    _parent.right = 0;
  19. }
  20. if(Key.isDown(Key.LEFT))
  21. {
  22.    _parent.left = _parent.left + 1;
  23. }
  24. else
  25. {
  26.    _parent.left = 0;
  27. }
  28. if(_root.control != "mouse")
  29. {
  30.    if((Key.isDown(Key.RIGHT) || Key.isDown(Key.LEFT)) && (_parent._x < 370 && 30 < _parent._x))
  31.    {
  32.       if(_parent._currentFrame == 1)
  33.       {
  34.          _parent.gotoAndStop("walk");
  35.       }
  36.    }
  37.    else if(_parent._currentFrame == 2)
  38.    {
  39.       _parent.gotoAndStop("stand");
  40.    }
  41.    if(Key.isDown(Key.RIGHT) && (_parent.left == 0 || _parent.right < _parent.left))
  42.    {
  43.       _parent._x += _root.speed;
  44.    }
  45.    if(Key.isDown(Key.LEFT) && (_parent.right == 0 || _parent.left < _parent.right))
  46.    {
  47.       _parent._x -= _root.speed;
  48.    }
  49. }
  50. else
  51. {
  52.    if((_root._xmouse < _parent._x - _root.speed || _parent._x + _root.speed < _root._xmouse) && (_parent._x < 370 && 30 < _parent._x))
  53.    {
  54.       if(_parent._currentFrame == 1)
  55.       {
  56.          _parent.gotoAndStop("walk");
  57.       }
  58.    }
  59.    else if(_parent._currentFrame == 2)
  60.    {
  61.       _parent.gotoAndStop("stand");
  62.    }
  63.    if(_parent._x + _root.speed < _root._xmouse)
  64.    {
  65.       _parent._x += _root.speed;
  66.    }
  67.    else if(_root._xmouse < _parent._x - _root.speed)
  68.    {
  69.       _parent._x -= _root.speed;
  70.    }
  71. }
  72. if(370 < _parent._x)
  73. {
  74.    _parent._x = 370;
  75. }
  76. else if(_parent._x < 30)
  77. {
  78.    _parent._x = 30;
  79. }
  80.